export const findRoutes = (config: any, key: string) => {
    let result: any[] = [];
    const handle = (opts: any) => {
        opts.forEach((item: any) => {
            if (item.path === key && item.children && item.children.length) {
                result = item.children;
            }
            if (item.path !== key && item.children && item.children.length) {
                handle(item.children);
            }
        })
    }
    handle(config);
    return result;
}